﻿using System;

namespace Needle.Bus.Messages.Attributes
{
    /// <summary>
    /// Indicates the maximum lifetime and or the maximum number of hops
    /// a message can make before it is considered garbage.
    /// </summary>
    public class TimeOutAttribute : Attribute
    {
        public TimeOutAttribute()
        {
            MaxHops = 1;
            MaxLifeTime = TimeSpan.MaxValue;
        }

        /// <summary>
        /// Default is 1, this enforces Point-to-Point connections and disables routing.
        /// </summary>
        public int MaxHops { get; set; }

        /// <summary>
        /// Default is TimeSpan.MaxValue, this makes sure messages can take their time to reach the destination.
        /// </summary>
        public TimeSpan MaxLifeTime { get; set; }

    }
}
